<%@ include file="connect.jsp" %>

<%
    String pert = request.getParameter("question");
    String answer = request.getParameter("answer");
    String detailtestID = request.getParameter("detailtestID");
    String idTest = request.getParameter("idTest");
    String target = request.getParameter("option");
    String ganti = pert.replaceAll("'", "''");

    stat.executeUpdate("INSERT INTO DetailQUestion (Answer, detailTestID,Question,target,stylesID)" +
            "values ('" + answer + "','" + detailtestID + "','" + ganti + "','"+target+"',2)");

    if (idTest.equals("1")) {
        response.sendRedirect("pretest.jsp?respon=Successfully added question!");


    } else {
        response.sendRedirect("posttest.jsp?respon=Successfully added question!");

    }
    conn.close();

%>